home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4547 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: news.texas.net!usenet
  2. From: Michael Douglass <mikedoug@texas.net>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: #define, question from a beginner
  5. Date: Mon, 05 Feb 1996 13:38:09 -0600
  6. Organization: Texas Networking, Inc.
  7. Message-ID: <31165CA1.2781E494@texas.net>
  8. References: <ma-010296161301@mac147.maths.uwa.edu.au> <31109AF8.423B@zess.uni-siegen.de> <TANMOY.96Feb1095641@qcd.lanl.gov>
  9. NNTP-Posting-Host: millenium.texas.net
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (X11; I; SunOS 4.1.4 sun4m)
  14.  
  15. Tanmoy Bhattacharya wrote:
  16. > In article <31109AF8.423B@zess.uni-siegen.de> Markus Becker
  17.  
  18. >    > #define fiveLines printf("%d, ",j); \ // macro should include
  19. > this first ==== here
  20. >    > /* comment is part of the macro \ // <- and here
  21. >    > the comment contains a few lines \ // <- and here
  22. >    and so on.
  23.  
  24. > Second, a comment can never be a part of a macro, because each comment
  25. > is treated as a single space before macros are recognized or
  26. > expanded. (Or rather, by the `as if' rule: the _meaning_ of the
  27. > program is as if the comments were replaced by spaces early on.) The \
  28. > followed by newline (NOT \ followed by spaces followed by newline or \
  29. > followed by // or other junk) is deleted even before the comment
  30. > processing (but after the trigraph processing so that ??/ followed by
  31. > newline is as good as \ followed by newline).
  32.  
  33. What I'm trying to figure out is *why* you want to include comments
  34. inside of a macro anyways...  The only thing that would see the expanded
  35. version w/ comments would be the compiler after preprocessing... Which
  36. would then barf on comments because the preprocessor takes the comments
  37. out... (Doesn't it?)
  38.  
  39. -- 
  40. Michael Douglass
  41. Texas Networking, Inc.
  42.  
  43. "I didn't change a thing and from the moment I didn't change it,
  44. it doesn't work anymore." -- Anonymous
  45.